import request from '@/utils/request'

export function getRoute() {
  return request({
    url: '/api/app/menu/route', // 假地址 自行替换
    method: 'get'
  })
}

export function GetTreeNodes(params) {
  return request({
    method: 'get',
    url: '/Menu/GetTreeNodes',
    params
  })
}

export function creatrMenu(data) {
  return request({
    method: 'post',
    url: '/api/app/menu',
    data
  })
}

export function getMenu(params) {
  return request({
    method: 'get',
    url: '/api/app/menu',
    params
  })
}

export function updateMenu(params, data) {
  return request({
    method: 'put',
    url: '/api/app/menu',
    params,
    data
  })
}

export function deleteMenu(params) {
  return request({
    method: 'delete',
    url: '/api/app/menu',
    params
  })
}

export function SwitchHidden(data) {
  return request({
    url: '/menu/SwitchHidden',
    method: 'post',
    data
  })
}

export function SwitchAffix(data) {
  return request({
    url: '/menu/SwitchAffix',
    method: 'post',
    data
  })
}
